/*
 * Copyright 2023 MindMotion Microelectronics Co., Ltd.
 * All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include "board_init.h"

/*
 * Macros.
 */

/*
 * Variables.
 */

/*
 * Declerations.
 */

void jump_to_app(void);
void msc_task(void);

/*
 * Functions.
 */

int main(void)
{
    BOARD_Init();

    /* read gpio pin level, select boot mode. */
    if (GPIO_ReadInDataBit(BOARD_BTN_PORT, BOARD_BTN_PIN))
    {
        /* update app & run. */
        jump_to_app();
    }
    else
    {
        /* run usb msc task. */
        msc_task();
    }

    /* cannot run here. */
    while(1)
    {}
}

/* EOF. */
